package com.flink.sync;

import com.flink.sync.oracle.TQrUser;
import com.flink.sync.oracle.OracleDataSource;
import com.flink.sync.oracle.Sink2Oracle;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.sink.PrintSinkFunction;



public class App {

	public static void main(String[] args) throws Exception {
		final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

		SingleOutputStreamOperator<TQrUser> streamOperator = env.addSource(
				new OracleDataSource()
		).setParallelism(10);

		streamOperator.addSink(new Sink2Oracle());
		streamOperator.addSink(new PrintSinkFunction<>());

		env.execute("Flink add oracle sink");
	}
}
